<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="keywords" content="江铃，仓储">
        <meta name="Description" content="描述">
        <title>欢迎登录仓储管理系统</title>
        <link rel="stylesheet" type="text/css" href="css/login_02.css">
        <link rel="stylesheet" href="js/lib/layui/css/layui.css" media="all" />
        <link rel="stylesheet" href="css/login.css" />
    </head>
<body>

<header>
    <ul>
        <li class='head-logo'>
            <img class='head_logo' src='images/login_logo.png' />
            <!--<img class='head_logo' src='images/home_nav_logo.png' />-->
        </li>
        <li class='head-t01'>
            <span>欢迎登录仓储管理系统</span>
        </li>
        <li class='head-t02'>
            <img src='images/icon_customer_service.png' />
            <a href="#"><span style="position: relative;left: 2px">中联客服</span></a>
        </li>
        <li class='head-t03'>
            <img src='images/icon_opinion.png' />
            <a href="#"><span style="position: relative;left: 2px">反馈意见</span></a>
        </li>
    </ul>
</header>
<section ng-app="loginApp" ng-controller="loginCtrl">
    <div id='container'>
        <div class="login-b01">
            <form class="layui-form">
                <p class="login-text01">登录您的系统</p>
                <ul>
                    <li>
                        <div class="layui-form-item" >
                            <input type="text" name="username" ng-model="login.username"  autocomplete="off" placeholder="这里输入登录名" class="layui-input">
                        </div>
                    </li>
                    <li>
                        <div class="layui-form-item">
                            <input type="password" name="password" ng-model="login.password" autocomplete="off" placeholder="这里输入密码" class="layui-input">
                        </div>
                    </li>

                    <li class="login-btn">
                        <div class="layui-form-item">
                            <div class="beg-pull-right">
                                <button class="layui-btn layui-btn-primary login-btn" ng-click="loginClick()">
                                    <i class="layui-icon">&#xe650;</i> 登录
                                </button>
                            </div>
                            <div class="beg-clear"></div>
                            <p><a href="#">忘记密码</a> | <a href="#">账户申请</a></p>

                        </div>
                    </li>
                </ul>
            </form>
        </div>
        <div class="login-b02">
            <ul>
                <li>&nbsp</li>
                <li>标准的作业流系统</li>
                <li>统一的数据交换系统</li>
                <li>完善的运力跟踪系统</li>
                <li>让我们的物流管理更显专业气质</li>
                <li>&nbsp</li>
                <li><p></p>——中联物流承诺给您更多！</li>
            </ul>
        </div>
    </div>
</section>
<footer>
    <div class="footer_text">
        <p>© 2005 - 2018 China-Union Logistics CO.,LTD. All Rights Reserved</p>
        <p><a href="#">关于中联物流</a> | <a href="#">服务条款</a></p>
    </div>
</footer>


<script type="text/javascript" src="js/lib/layui/layui.js"></script>
<script type="text/javascript" src="js/lib/jquery/jquery-1.9.1.min.js"></script>
<script src="js/lib/angular/angular.min.js" type="text/javascript"></script>
<script src="js/lib/angular-cookies/angular-cookies.min.js" type="text/javascript"></script>

<script>
    angular.module('loginApp',['ngCookies'])
        .run(['$location',function (location) {
        }])
        .controller('loginCtrl',['$scope','$cookies',function(scope,cookies){
            scope.loginClick = function(){
                layui.use(['layer'], function() {
                    var layer = layui.layer,
                        $ = layui.jquery;
                    if(!scope.login || !scope.login.username || !scope.login.password){
                        layer.alert('用户名或密码不能为空');
                        return;
                    }
                    $.ajax({
                        type: 'POST',
                        url:'<%=host%>sysUser/loginForWeb',
                        contentType : 'application/json;charset=UTF-8',
                        data:JSON.stringify(scope.login),
                        success:function(data){
                            if(data.success){
                                delete data.data.permisssList
                                cookies.putObject('user',data.data);
                                var t = cookies.getObject('user');
                                location.href = 'index'
                            } else {
                                $('input').blur();  //清除焦点
                                layer.alert(data.message);
                            }
                        }
                    });
                });
                return false;
            }
        }])
</script>

</body>
</html>